 $.addLayerExt();

$('.addLike').click(function(){
  	var robotCount = $('#robotCount').attr('data-id');

  	var id = $(this).attr('data-id');

	layer.prompt({
	    title: '当前Robot数量 '+robotCount+' 输入正确的机器人数量，并确认',
	    formType: 0 //prompt风格，支持0-2
	}, function(pass){

	   	var index = layer.load(1, {
		    shade: [0.1,'#fff'] //0.1透明度的白色背景
		});

		$.post("/info/like",	
			{'num':pass, 'id':id},
			function(result){
	            if(result.status == true){
	              
	                // $(".head-title").append($.successAlert(result.msg+" 3秒后自动跳转"));
	             	$.successAlert(result.msg);

					setTimeout(function (){window.location.href='/info'}, 3000)
	            }else{
	            	$.errorAlert(result.msg);

					return false;	
	            }
		},"json");

	});
	

})

